import moment from 'moment'

export function formatDateTime(time?: string) {
  if (!time) {
    return 'N/A'
  }
  return moment(new Date(time)).format('YYYY-MM-DD HH:mm:ss')
}

export function formatDate(time?: string) {
  if (!time) {
    return 'N/A'
  }
  return moment(new Date(time)).format('YYYY-MM-DD')
}

export function formatTimeHours(time?: string) {
  if (!time) {
    return 'N/A'
  }
  return moment(new Date(time)).format('hh:mm:ss')
}
